Optimal. Leaf size=25 \[ \frac {b x}{2}-\frac {1}{2} b \cos (x) \sin (x)+\frac {1}{2} a \sin ^2(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3168, 2644, 30,
2715, 8} \begin {gather*} \frac {1}{2} a \sin ^2(x)+\frac {b x}{2}-\frac {1}{2} b \sin (x) \cos (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2644
Rule 2715
Rule 3168
Rubi steps
\begin {align*} \int \sin (x) (a \cos (x)+b \sin (x)) \, dx &=\int \left (a \cos (x) \sin (x)+b \sin ^2(x)\right ) \, dx\\ &=a \int \cos (x) \sin (x) \, dx+b \int \sin ^2(x) \, dx\\ &=-\frac {1}{2} b \cos (x) \sin (x)+a \text {Subst}(\int x \, dx,x,\sin (x))+\frac {1}{2} b \int 1 \, dx\\ &=\frac {b x}{2}-\frac {1}{2} b \cos (x) \sin (x)+\frac {1}{2} a \sin ^2(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 25, normalized size = 1.00 \begin {gather*} \frac {b x}{2}-\frac {1}{2} a \cos ^2(x)-\frac {1}{4} b \sin (2 x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 21, normalized size = 0.84
method | result | size |
risch | \(\frac {b x}{2}-\frac {a \cos \left (2 x \right )}{4}-\frac {b \sin \left (2 x \right )}{4}\) | \(20\) |
default | \(-\frac {\left (\cos ^{2}\left (x \right )\right ) a}{2}+b \left (-\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )\) | \(21\) |
meijerg | \(\frac {a \sqrt {\pi }\, \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (2 x \right )}{\sqrt {\pi }}\right )}{4}+\frac {b \sqrt {\pi }\, \left (\frac {2 x}{\sqrt {\pi }}-\frac {\sin \left (2 x \right )}{\sqrt {\pi }}\right )}{4}\) | \(43\) |
norman | \(\frac {b \left (\tan ^{3}\left (\frac {x}{2}\right )\right )+2 a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+b x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+\frac {b x}{2}-b \tan \left (\frac {x}{2}\right )+\frac {b x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{2}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{2}}\) | \(60\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.35, size = 21, normalized size = 0.84 \begin {gather*} -\frac {1}{2} \, a \cos \left (x\right )^{2} + \frac {1}{4} \, b {\left (2 \, x - \sin \left (2 \, x\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.04, size = 19, normalized size = 0.76 \begin {gather*} -\frac {1}{2} \, a \cos \left (x\right )^{2} - \frac {1}{2} \, b \cos \left (x\right ) \sin \left (x\right ) + \frac {1}{2} \, b x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.05, size = 37, normalized size = 1.48 \begin {gather*} \frac {a \sin ^{2}{\left (x \right )}}{2} + \frac {b x \sin ^{2}{\left (x \right )}}{2} + \frac {b x \cos ^{2}{\left (x \right )}}{2} - \frac {b \sin {\left (x \right )} \cos {\left (x \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 19, normalized size = 0.76 \begin {gather*} \frac {1}{2} \, b x - \frac {1}{4} \, a \cos \left (2 \, x\right ) - \frac {1}{4} \, b \sin \left (2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.41, size = 19, normalized size = 0.76 \begin {gather*} \frac {a\,{\sin \left (x\right )}^2}{2}-\frac {b\,\cos \left (x\right )\,\sin \left (x\right )}{2}+\frac {b\,x}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________